<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>LiteGraph</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: </em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/ContextMenu.html">ContextMenu</a></li>
                                <li><a href="../classes/LGraph.html">LGraph</a></li>
                                <li><a href="../classes/LGraphCanvas.html">LGraphCanvas</a></li>
                                <li><a href="../classes/LGraphNode.html">LGraphNode</a></li>
                                <li><a href="../classes/LiteGraph.html">LiteGraph</a></li>
                            </ul>
                
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>LiteGraph Class</h1>
<div class="box meta">


        <div class="foundat">
            Defined in: <a href="../files/.._src_litegraph.js.html#l6"><code>..&#x2F;src&#x2F;litegraph.js:6</code></a>
        </div>


</div>


<div class="box intro">
    <p>The Global Scope. It contains all the registered node classes.</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
<div id="method_LiteGraph" class="method item">
    <h3 class="name"><code>LiteGraph</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l6"><code>..&#x2F;src&#x2F;litegraph.js:6</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>




</div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                            <li class="index-item method">
                                <a href="#method_addNodeMethod">addNodeMethod</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_createNode">createNode</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getNodeType">getNodeType</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getNodeType">getNodeType</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getNodeTypesCategories">getNodeTypesCategories</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_registerNodeType">registerNodeType</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_wrapFunctionAsNode">wrapFunctionAsNode</a>

                            </li>
                    </ul>
                </div>



        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_addNodeMethod" class="method item">
    <h3 class="name"><code>addNodeMethod</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>func</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l193"><code>..&#x2F;src&#x2F;litegraph.js:193</code></a>
        </p>



    </div>

    <div class="description">
        <p>Adds this method to all nodetypes, existing and to be created
(You can add it to LGraphNode.prototype but then existing node types wont have it)</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">func</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_createNode" class="method item">
    <h3 class="name"><code>createNode</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>name</code>
                </li>
                <li class="arg">
                        <code>options</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l211"><code>..&#x2F;src&#x2F;litegraph.js:211</code></a>
        </p>



    </div>

    <div class="description">
        <p>Create a node of a given type with a name. The node is not attached to any graph yet.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>full name of the node class. p.e. &quot;math/sin&quot;</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>a name to distinguish from other nodes</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">options</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>to set options</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_getNodeType" class="method item">
    <h3 class="name"><code>getNodeType</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Class</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l270"><code>..&#x2F;src&#x2F;litegraph.js:270</code></a>
        </p>



    </div>

    <div class="description">
        <p>Returns a registered node type with a given name</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>full name of the node class. p.e. &quot;math/sin&quot;</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Class</span>:
                    <p>the node class</p>

            </div>
        </div>


</div>
<div id="method_getNodeType" class="method item">
    <h3 class="name"><code>getNodeType</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>category</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l281"><code>..&#x2F;src&#x2F;litegraph.js:281</code></a>
        </p>



    </div>

    <div class="description">
        <p>Returns a list of node types matching one category</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">category</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>category name</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>array with all the node classes</p>

            </div>
        </div>


</div>
<div id="method_getNodeTypesCategories" class="method item">
    <h3 class="name"><code>getNodeTypesCategories</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l309"><code>..&#x2F;src&#x2F;litegraph.js:309</code></a>
        </p>



    </div>

    <div class="description">
        <p>Returns a list with all the node type categories</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>array with all the names of the categories</p>

            </div>
        </div>


</div>
<div id="method_registerNodeType" class="method item">
    <h3 class="name"><code>registerNodeType</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>base_class</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l93"><code>..&#x2F;src&#x2F;litegraph.js:93</code></a>
        </p>



    </div>

    <div class="description">
        <p>Register a node class so it can be listed when the user wants to create a new one</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>name of the node and path</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">base_class</code>
                        <span class="type">Class</span>


                    <div class="param-description">
                        <p>class containing the structure of a node</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_wrapFunctionAsNode" class="method item">
    <h3 class="name"><code>wrapFunctionAsNode</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>name</code>
                </li>
                <li class="arg">
                        <code>func</code>
                </li>
                <li class="arg">
                        <code>param_types</code>
                </li>
                <li class="arg">
                        <code>return_type</code>
                </li>
                <li class="arg">
                        <code>properties</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/.._src_litegraph.js.html#l160"><code>..&#x2F;src&#x2F;litegraph.js:160</code></a>
        </p>



    </div>

    <div class="description">
        <p>Create a new node type by passing a function, it wraps it with a propper class and generates inputs according to the parameters of the function.
Useful to wrap simple methods that do not require properties, and that only process some input to generate an output.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">name</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>node name with namespace (p.e.: 'math/sum')</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">func</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">param_types</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>[optional] an array containing the type of every parameter, otherwise parameters will accept any type</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">return_type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        <p>[optional] string with the return type, otherwise it will be generic</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">properties</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        <p>[optional] properties to be configurable</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
            </div>



    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
